<?php

use think\migration\Migrator;
use think\migration\db\Column;

class ExtensionEavAttributeOption extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     */
    public function change()
    {
        $table = $this->table('extension_eav_attribute_option', ['engine' => 'InnoDB', 'comment' => '属性选项表']);
        $table->addColumn(Column::unsignedInteger('attribute_id')->setComment('属性ID'))
            ->addColumn(Column::string('label')->setComment('显示文本'))
            ->addColumn(Column::string('value')->setComment('选项值'))
            ->addColumn(Column::unsignedInteger('sort')->setComment('排序'))
            ->addTimestamps()
            ->addSoftDelete()
            ->addIndex(['attribute_id'])
            ->create();
    }
}
